<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="head"></div>
    <!-- DataTables -->
    <link rel="stylesheet" th:href="@{/plugins/datatables/dataTables.bootstrap.css}"/>
    <title>不迷失-Admin Book管理</title>
</head>

<body class="hold-transition skin-blue sidebar-mini ">
<div class="wrapper">

    <div th:replace="header"></div>
    <div th:replace="sidebar"></div>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">


        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">

                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">book管理</h3>
                            <a th:href="@{/blogsite/book/form}" title="新建book" style="margin-left:15px"><span
                                    class="glyphicon glyphicon-plus"></span></a>
                        </div>
                        <h2 th:if="${!rep.success}" th:text="${rep.msg}"></h2>
                        <div class="box-body">
                            <table id="dataTable" class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>名称</th>
                                    <th>分类</th>
                                    <th>描述</th>
                                    <th>创建时间</th>
                                    <th>修改</th>
                                    <th>目录管理</th>
                                    <th style="text-align: center">删除</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="item:${rep.data.list}">
                                    <td th:text="${item.name}">标题</td>
                                    <td th:text="${item.catalogDisplay}">分类</td>
                                    <td th:text="${item.description}?${item.description}">标题</td>
                                    <td th:text="${#dates.format(item.publishTime,'yyyy/MM/dd HH:mm')}"></td>
                                    <td style="text-align: center">
                                        <a th:href="@{/blogsite/book/form(id=${item.id})}"><span
                                                class="glyphicon glyphicon-edit"
                                                title="编辑"></span></a>
                                    </td>

                                    <td style="text-align: center">
                                        <a th:href="@{/blogsite/book/{bookId}/indexs(bookId=${item.id})}"><span
                                                class="glyphicon glyphicon-edit"
                                                title="目录管理"></span></a>
                                    </td>

                                    <td style="text-align: center">

                                        <span name="trash" title="删除"
                                              th:data="@{/blogsite/book/{id}/delete(id=${item.id})}"
                                              style="cursor: pointer" class="glyphicon glyphicon-trash"></span>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.box-body -->
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>

        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->


</div>

<div th:replace="script"></div>

<!-- page script -->
<script>
    $(function () {
        $('#dataTable').DataTable({
            "paging": true,
            "lengthChange": false,
            "searching": false,
            "ordering": true,
            "info": true,
            "autoWidth": false
        });
    });
</script>
<script th:src="@{/js/ajax-setup.js}"></script>
<script th:src="@{/js/list-page.js}"></script>
</body>
</html>